/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.protocol.active;

import info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BCD;
import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BIN;

/**
 * <b>(DianlanRecharge)</b>
 * <p>
 * 云快充充值
 * 帧类型码 0x42
 * 序列号域 0006
 * 数据长度
 * 帧校验域 4622
 *
 * @author czj
 * @version 1.0.0
 * @since 2023/2/9
 */
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class DianlanRecharge {
    /** 桩编码 */
    @DianlanProtocol(length = 7, start = 0, end = 7, dataType = BCD)
    String stubNo;
    /** 枪号 */
    @Builder.Default
    @DianlanProtocol(length = 1, start = 7, end = 8, dataType = BCD)
    String chargingPortNo = "01";
    /** 物理卡号 */
    @Builder.Default
    @DianlanProtocol(length = 8, start = 8, end = 16, dataType = BIN)
    String physicsCardNo  = "0000000000000001";
    /** 修改后金额 */
    @Builder.Default
    @DianlanProtocol(length = 4, start = 16, end = 20, dataType = BIN)
    String amount         = "99999999";

}